package com.mmall.common;

/**
 * Created by Administrator on 2018/11/7.
 */
public enum ResponseCode {
//    给枚举元素赋值
    SUCCESS(0, "SUCCESS"),
    ERROR(1, "ERROR"),
    NEED_LOGIN(10, "NEED_LOGIN"),
    ILLGAL_ARGUMENT(2, "ILLGAL_ARGUMENT");

//    定义枚举的属性，通过这两个属性，可以获取到枚举默认的值
    private final int code;
    private final String desc;

    ResponseCode(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode(){
        return code;
    }
    public String getDesc(){
        return desc;
    }
}
